package com.xyz.gate.service;

import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

/**
 * 不需要登陆访问的url集合
 */
@Service
public class WhitelistUrl {
    private static Set<String> whiteList = new HashSet<>();

    static {
        whiteList.add("/api/auth/login");
    }

    public boolean isNeedLogin(String url) {
        for(String s:whiteList) {
            if(url.startsWith(s)) {
                return false;
            }
        }
        return true;
    }

}
